package com.atguigu.gmall.mq.controller;

import com.atguigu.gmall.common.config.RabbitService;
import com.atguigu.gmall.common.result.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 搭忆长安
 * @version 1.0
 * @date 2021年07月12日 18:35
 * @ClassName:MqController
 * @Description: TODO
 */
@RestController
@RequestMapping("/send")
public class MqController {

    @Autowired
    private RabbitService rabbitService;

    /**
     * 发送消息测试
     * @return
     */
    @GetMapping
    public String sendConfirm(){
        rabbitService.sendMessage("java_exchange","java.insert","测试消息");
        return  "发送完成";
    }
}
